package org.geekforum.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.geekforum.common.AppResult;
import org.geekforum.exception.ApplicationException;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "系统管理")
@RestController // 不需要路径参数
public class TestController {

    @ApiOperation("测试")
    @GetMapping("/exception")
    public AppResult test(@ApiParam("姓名") String name) throws Exception {
        System.out.println(name);
        throw new Exception("11111");
    }

    @GetMapping("/appException")
    public String testApplicationException() {
        throw new ApplicationException(" ApplicationException");
    }
}
